<?php $this->placeholder('onReady')->captureStart() ?>
    
	$("#<?php echo $this->id_tablesorter?>").tablesorter();


<?php $this->placeholder('onReady')->captureEnd() ?>

<style>

.fild{
    margin: 3px;
    padding: 3px;
}
.comprometido_0{
    color:red;
}
.comprometido_1{
    color:green;
}

.importe_noc{
    float:right;
    text-align:left;
    font-size: 1.2em;
    margin-bottom:5px;
    padding:4px;
    width:300px

}

</style>

<br />

<?=$this->msg($this->proyecto['proyecto'].' - Seguimiento Inversiones');?>

<?php echo $this->anchor($this->controllerName.'/insertar/id_proyecto/'.$this->id_proyecto,'Añadir',array('class'=>'utiladd'));?>

<div class="ui-widget-header importe_noc">
Importe NOC : <?=$this->numEs($this->proyecto['noc'],0) ?> €<br />
</div>

<br />
<?if(!empty($this->rows['conceptos'])):?>
<table id="myTable" width="100%" class="tablesorter"> 
<thead>
<tr> 
	<th>Concepto</th> 
    <?foreach($this->rows['fechas'] as $f):?>
        <th width="70px"><?=$f['fechas']?></th>
    <?endforeach?>
	<th width="70px"><?php echo $this->translate('Contratado');?></th>
    <th width="70px"><?php echo $this->translate('Previsto');?></th>
    <th width="70px"><?php echo $this->translate('Avance');?></th>
</tr> 
</thead> 

<tbody> 
<?foreach($this->rows['conceptos'] as $k => $v):?>
<tr id="fila-<?=$v['id'];?>"> 
	<td valign="top"><?=$k?></td>
    <?foreach($this->rows['fechas'] as $k => $f):?>
        <td align="right">
        <span class="comprometido_<?=$v[$k]['comprometido']?>"><?=$this->numEs($v[$k]['importe'],0)?></span>
        <?=($v[$k]['id']) ? $this->anchor('/proyectosdc-capex-detalle/editar/id_proyecto/'.$this->id_proyecto.'/id/'.$v[$k]['id'],'Añadir',array('class'=>'utileditar')) : '';?>
        </td>
    <?endforeach?>
    
   <td align="right" valign="top"><?=$this->numEs($v['suma_1'],0)?></td>
   <td align="right" valign="top"><?=$this->numEs($v['suma_0'],0)?></td>
   <td align="right" valign="top"><?=$this->numEs($v['suma'],0)?></td>
     
</tr> 
<?endforeach?>
</tbody>
<tfoot>
<tr> 
	<th></th> 
    <?foreach($this->rows['fechas'] as  $f):?>
        <th><?=$this->numEs($f['importes'],0)?>€</th>
    <?endforeach?>
	<th><?=$this->numEs($this->rows['suma_1'],0)?>€</th>
    <th><?=$this->numEs($this->rows['suma_0'],0)?>€</th>
    <th><?=$this->numEs($this->rows['suma'],0)?>€</th>
</tr> 
</tfoot> 
</table>

<?else:
print $this->msg('No hay Información');
endif?>

<div  style="width:45%;;float:left">

<h1 class="h1_head">Notas </h1>

<?php echo $this->anchor('/proyectosdc-capex/editar/id/'.$this->id_proyecto,'Añadir',array('class'=>'utileditar'));?>
        <div id="notas" class="ui-state-highlight">
            <?=$this->text($this->proyecto['notas_capex'])?>&nbsp;
        </div>
		
       
</div>

<div style="height:420px">&nbsp;</div>
